<template>
  <div class="home">
    <!-- 新冠病毒信息介绍 -->
    <CovidInfo :covid19Info="covid19Info" />
    <!-- 国内新冠病毒信息 -->
    <CovidNum :caseNum="caseNum" />
    <!-- 国内-国外疫情地图 映射国外数据-->
    <CovidMap />
    <!-- 轮播图 -->
    <VueSwiper />
    <!-- 城市出行选择 -->
    <VantSelect />

    <!-- 最新消息 -->
   <CovidNews :news='news'/>

  </div>
</template>

<script>
import CovidInfo from "./Covide/CovidInfo";
import CovidNum from "./Covide/CovidNum";
import CovidMap from "./Covide/CovidMap";
import VueSwiper from "../components/VueSwiper";
import VantSelect from "../components/VantSelect";
import CovidNews from './Covide/CovidNews';
export default {
  name: "Home",
  data() {
    return {
      covid19Info: {},
      caseNum: {},
      news: [],
    };
  },
  components: {
    CovidInfo,
    CovidNum,
    CovidMap,
    VueSwiper,
    VantSelect,
    CovidNews
  },
  mounted() {
    this.$api.getCovidInfo().then((res) => {
      if (res.data.code == 200) {
        console.log("-----", res.data);
        // 病毒信息
        this.covid19Info = {
          note1: res.data.newslist[0].desc.note1,
          note2: res.data.newslist[0].desc.note2,
          note3: res.data.newslist[0].desc.note3,
          remark1: res.data.newslist[0].desc.remark1,
          remark2: res.data.newslist[0].desc.remark2,
          remark3: res.data.newslist[0].desc.remark3,
        };
        // 病例数
        this.caseNum = {
          currentConfirmedCount:
            res.data.newslist[0].desc.currentConfirmedCount, //现存确诊人数
          confirmedCount: res.data.newslist[0].desc.confirmedCount, //累计确诊人数
          suspectedCount: res.data.newslist[0].desc.suspectedCount, //累计境外输入人数
          curedCount: res.data.newslist[0].desc.curedCount, //	累计治愈人数
          deadCount: res.data.newslist[0].desc.deadCount, //	累计死亡人数
          seriousCount: res.data.newslist[0].desc.seriousCount, //现存无症状人数
          suspectedIncr: res.data.newslist[0].desc.suspectedIncr, //新增境外输入人数
          currentConfirmedIncr: res.data.newslist[0].desc.currentConfirmedIncr, //相比昨天现存确诊人数
          confirmedIncr: res.data.newslist[0].desc.confirmedIncr, //相比昨天累计确诊人数
          curedIncr: res.data.newslist[0].desc.curedIncr, //相比昨天新增治愈人数
          deadIncr: res.data.newslist[0].desc.deadIncr, //相比昨天新增死亡人数
          seriousIncr: res.data.newslist[0].desc.seriousIncr, //相比昨天现存无症状人数
          modifyTime: res.data.newslist[0].desc.modifyTime, //新闻截止时间
        };
        //最新新闻----
        this.news = res.data.newslist[0].news;
        console.log(this.news);
      }
    });
  },
};
</script>

<style scoped>

</style>
